package test3_20.demo05;

public class Actor {

    public void personRun(Pet pet){
        System.out.println("人开始跑");
        if (pet instanceof  Cat){
            Pet p = new Cat();
            p.run();
        }else if(pet instanceof  Dog){
            Pet p = new Dog();
            p.run();
        }else if(pet instanceof  Rabbit) {
            Pet p = new Rabbit();
            p.run();
        }
    }
}
